<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <p>1 、shift():删除数组的第一个元素,返回删除的值。这里是0 </p>
    <p>2 、unshift(3,4):把参数加载数组的前面，返回数组的长度。现在list:中是3,4,0,1,2 </p>
    <p>3、pop():删除数组的最后一个元素，返回删除的值。这里是2. </p>
    <p>4、push(3):将参数加载到数组的最后，返回数组的长度，现在List中时：0,1,2,3 </p>
    <p>5、concat(3,4):把两个数组拼接起来。 </p>
    <p>6、splice(start,deleteCount,val1,val2,...)：从start位置开始删除deleteCount项，并从该位置起插入val1,val2,...</p>
    <p>7、reverse：将数组反序 </p>
<pre class="prettyprint prettyprinted"><code><span class="kwd">var</span><span class="pln"> a </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[</span><span class="lit">1</span><span class="pun">,</span><span class="lit">2</span><span class="pun">,</span><span class="lit">3</span><span class="pun">,</span><span class="lit">4</span><span class="pun">,</span><span class="lit">5</span><span class="pun">];</span><span class="pln">
</span><span class="kwd">var</span><span class="pln"> b </span><span class="pun">=</span><span class="pln"> a</span><span class="pun">.</span><span class="pln">reverse</span><span class="pun">();</span><span class="pln"> </span><span class="com">//a：[5,4,3,2,1] b：[5,4,3,2,1] </span></code></pre>
    <p>8、sort(orderfunction)：按指定的参数对数组进行排序  var a = [1,2,3,4,5];  var b =
        a.sort(); //a：[1,2,3,4,5] b：[1,2,3,4,5] </p>
    <p>9、slice(start,end)：返回从原数组中指定开始下标到结束下标之间的项组成的新数组 </p>
<pre class="prettyprint prettyprinted"><code><span class="kwd">var</span><span class="pln"> a </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[</span><span class="lit">1</span><span class="pun">,</span><span class="lit">2</span><span class="pun">,</span><span class="lit">3</span><span class="pun">,</span><span class="lit">4</span><span class="pun">,</span><span class="lit">5</span><span class="pun">];</span><span class="pln">
</span><span class="kwd">var</span><span class="pln"> b </span><span class="pun">=</span><span class="pln"> a</span><span class="pun">.</span><span class="pln">slice</span><span class="pun">(</span><span class="lit">2</span><span class="pun">,</span><span class="lit">5</span><span class="pun">);</span><span class="pln"> </span><span class="com">//a：[1,2,3,4,5] b：[3,4,5]</span></code></pre>
</body>
</html>